public class Main {
    //判断排序是否正确
    private static boolean isOrdered(int[] nums){
        for(int i = 0;i<nums.length-1;i++){
            if(nums[i]>nums[i+1]) return false;
        }
        return true;
    }

    public static void main(String[] args) {
        int[] nums = MockData.mockNums();
        //long startTime = System.nanoTime();//纳秒级
        long startTime = System.currentTimeMillis();//毫秒级
        //Sort.insertSort(nums);//插入排序
        Sort.mergeSort(nums);//归并排序
        //long endTime = System.nanoTime();//纳秒级
        long endTime = System.currentTimeMillis();
        long elapsedTime = endTime - startTime;
        System.out.println(elapsedTime);
        System.out.println(isOrdered(nums));
    }
}
